<template>
  <page-header-wrapper :title="false">
    <a-card>
      <a-form-model
        :label-col="labelCol"
        :wrapper-col="wrapperCol"
      >
        <a-row :gutter="20">
          <a-col :span="12">
            <a-card
              :loading="loading"
              title="基本信息"
            >
              <a-form-model-item label="业务类型">
                <b>{{businessDetail.category}}</b>
              </a-form-model-item>
              <a-form-model-item label="合同/业务编号">
                <b>{{businessDetail.contract_no}}/{{businessDetail.business_no}}</b>
              </a-form-model-item>
              <a-form-model-item label="业务名称">
                <b>{{businessDetail.business_name}}</b>
              </a-form-model-item>
              <a-form-model-item label="客户姓名">
                <b>{{businessDetail.customer_name}}</b>
              </a-form-model-item>
              <a-form-model-item label="申请主体">
                <b>{{businessDetail.subject}}</b>
              </a-form-model-item>
              <a-form-model-item label="业务价格/官费">
                <b>{{businessDetail.price}}/{{businessDetail.official_fee}}</b>
              </a-form-model-item>
              <a-form-model-item label="开启时间">
                <b>{{businessDetail.open_time}}</b>
              </a-form-model-item>
              <a-form-model-item label="注册号">
                <b>{{businessDetail.sb_reg_no}}{{businessDetail.zl_no}}{{businessDetail.bq_no}}</b>
              </a-form-model-item>
              <a-form-model-item label="注册名称">
                <b>{{businessDetail.sb_name}}{{businessDetail.zl_name}}{{businessDetail.bq_name}}</b>
              </a-form-model-item>
              <a-form-model-item label="商标类别">
                <b>{{businessDetail.sb_category}}</b>
              </a-form-model-item>
            </a-card>
          </a-col>
          <a-col :span="12">
            <a-card
              :loading="loading"
              title="流转记录"
            >
              <a-timeline>
                <a-timeline-item v-for="item in histories" :key="item.circul_id">
                  【{{item.created_at}}】<br>
                  {{item.step}}{{item.username}}，{{item.notes}}
                </a-timeline-item>
              </a-timeline>
            </a-card>
          </a-col>
        </a-row>
      </a-form-model>
    </a-card>
  </page-header-wrapper>
</template>

<script>
import { getBusinessDetail } from '@/api/contract'

export default {
  name: 'BusinessDetail',
  data () {
    return {
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      businessDetail: {},
      histories: {},
      loading: true
    }
  },
  created () {
    this.loading = true
    getBusinessDetail(this.$route.params.id).then(res => {
      this.businessDetail = res.result.contractBusinessDetail
      this.histories = res.result.histories
      this.loading = false
    })
  }
}
</script>

<style scoped>

</style>
